#pragma once
class XmlTree;
class AttrTree;
class Canvas : public ui::ScrollableBox
{
public:
	Canvas();
	~Canvas();
	void InitCanvas(XmlTree* xmlTree, AttrTree *pAttrTree){ m_pXmlTree = xmlTree; m_pAttrTree = pAttrTree; };
	bool AddControl(Control* control);
	bool AddBox(Box* box);
	bool SelectControlById(std::string id);
private:
	Box *m_pRoot{ nullptr };
	Control *m_pControlSel{ nullptr };

	XmlTree *m_pXmlTree;
	AttrTree *m_pAttrTree;

	int m_nControlIndex = 0;
	std::map<std::string, Control*>	m_mapControl;		//key:m_nControlIndex
};

